home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS25.ADF
/
DiskWipe
/
execsup.c
< prev
next >
Wrap
C/C++ Source or Header
|
1989-01-26
|
1KB
|
47 lines
#include "diskwipe.h"
struct MsgPort *NewPort()
{
UBYTE sigbit;
struct MsgPort *port;
if ((sigbit = AllocSignal(-1)) == -1)
return(NULL);
if ((port = (struct MsgPort *)
AllocMem((ULONG)sizeof(struct MsgPort),
MEMF_CLEAR|MEMF_PUBLIC)) == NULL)
{
FreeSignal(sigbit);
return(NULL);
}
port->mp_Node.ln_Type = NT_MSGPORT;
port->mp_Flags = PA_SIGNAL;
port->mp_SigBit = sigbit;
port->mp_SigTask = FindTask(0);
NewList(&(port->mp_MsgList));
return(port);
}
void DisposePort(port)
struct MsgPort *port;
{
FreeSignal(port->mp_SigBit);
FreeMem((char *)port, (ULONG)sizeof(*port));
}
struct IOExtTD *CreateIOExtTD(mp)
struct MsgPort *mp;
{
struct IOExtTD *ioext;
if ((ioext = (struct IOExtTD *)
AllocMem(sizeof(struct IOExtTD),
MEMF_CLEAR|MEMF_PUBLIC)) != NULL)
{
ioext->iotd_Req.io_Message.mn_Node.ln_Type = NT_MESSAGE;
ioext->iotd_Req.io_Message.mn_ReplyPort = mp;
}
return(ioext);
}